home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_360 / uucp / uucp0.lzh / src / uuser / uuser.doc < prev    next >
Text File  |  1990-02-02  |  2KB  |  72 lines

  1.  
  2.                 UUSER.DOC
  3.  
  4.                 UUSER V1.00 Beta
  5.  
  6.     $Header: Beta:src/uucp/src/uuser/RCS/uuser.doc,v 1.1 90/02/02 12:10:18 dillon Exp Locker: dillon $
  7.  
  8.     UUSER: (C) Copyright 1989-1990 by Matthew Dillon,  All Rights Reserved.
  9.  
  10.  
  11.     Currently UUSER: works only with single sessions started
  12.     by Getty (this has to do with how UUSER: deals with carrier
  13.     detect).  THIS WILL BE FIXED.
  14.  
  15.     Openning UUSER:
  16.  
  17.     fopen("UUSER:devicename/unit/options", ...);
  18.  
  19.     Example:
  20.             (suggested)
  21.  
  22.     int  fd = open("UUSER:serial.device/0/R1000", O_RDWR | O_CREAT | O_TRUNC);
  23.  
  24.             (also can do this -- see below for problems using
  25.              stdio to read)
  26.  
  27.     FILE *rfi = fopen("UUSER:serial.device/0/R1000", "r");
  28.     FILE *wfi = fopen("UUSER:serial.device/0/R1000", "w");
  29.  
  30.  
  31.     Features:
  32.  
  33.     * 1K asynchronous write buffer for each file handle.  I.E.
  34.       your write() will return when 1K or less remains to be
  35.       written (UUSER: has a 1K buffer for spooling these per
  36.       file handle)
  37.  
  38.     * selectable read timeout
  39.  
  40.     * read poll
  41.  
  42.     * carrier lost handling
  43.  
  44.     General:
  45.  
  46.     (1) Use Level 1 I/O if you can (read/write)
  47.         read() returns 0 on timeout, -1 on carrier lost
  48.         otherwise, read() returns the immediate number of
  49.         data bytes ready up to the amount you requested.
  50.         (i.e. if you read(0,buf,256) you can get anywhere from
  51.         -1, 0, 1 to 256 back).
  52.  
  53.         write() returns the number you wrote or -1 (lost carrier)
  54.  
  55.         To 'poll' data ready you can read(0, NULL, 0) .. reading
  56.         0 bytes returns 0 (data ready) or -1 (data not ready).
  57.         NOTE: 0 (data ready) will be returned if carrier is lost
  58.         when you read 0 bytes... this is so your program thinks
  59.         data is ready and when it does a real read it finds that
  60.         carrier was lost!
  61.  
  62.     (2) If you want to use Level 2 I/O (stdio) I suggest you use
  63.         it for writing only.  If you really want to use it for
  64.         reading remember that the timeout will cause an EOF
  65.         condition which must be cleared (clrerr()).  And you
  66.         must call ferror() to determine whether an EOF is an
  67.         EOF (timeout()) or an actual error (lost carrier).
  68.  
  69.     REFER TO UUSERDUMP.C for a working source example.
  70.  
  71.  
  72.